export default {
	data(){
		return {
			userInfo:{},
			loadMoreStatus:'loadmore',
			cellList:[],
			Amount: 0,
			pageCount: 1,
			pageIndex: 1,
			pageSize: 10,
		}
	},
	methods: {
		getData(url,ix, size, type, data_type){
			this.loadMoreStatus = 'loading'
			this.$reqGet(url, {
				page_index: ix,
				page_size: size,
				type: type,
				data_type: data_type
			}).then(res=>{
				if(res.Status === 1){
					this.loadMoreStatus = 'loadmore'
					this.Amount = res.Data.amount || res.Data.integral
					this.pageCount = res.Page_Count
					this.userInfo.FAmount = res.Data.amount
					this.userInfo.FIntegral = res.Data.integral
					if(this.pageIndex === 1){
						this.cellList = res.Data.list
					}else {
						this.cellList = [...this.cellList, ...res.Data.list]
					}
				}
			})
		},
		onScrollToLower(){
			if(this.pageCount > this.pageIndex && this.loadMoreStatus !== 'loading'){
				this.pageIndex++
				this.getData(this.loadUrl,this.pageIndex, this.pageSize, this.type, this.data_type)
			}else if(this.pageCount === this.pageIndex){
				this.loadMoreStatus = 'nomore'
			}
		}
	}
}